const express = require("express");
const router = express.Router();
const expressJoi = require("@escook/express-joi");
const handler = require("../router_handler/userinfo");
const schema = require("../sechma/userinfo");
// 获取用户信息
router.get("/userinfo", handler.getUserInfo);
// 更新用户信息
router.post(
  "/userinfo",
  expressJoi(schema.userInfoSchema),
  handler.updateUserInfo
);
// 重置密码
router.post(
  "/updatepwd",
  expressJoi(schema.update_password_schema),
  handler.updatePassword
);
// 更新用户头像
router.post(
  "/update/avatar",
  expressJoi(schema.update_avatar_schema),
  handler.updateAvatar
);
module.exports = router;
